HAL CRC macro migration

This section provides information about the HAL CRC macro migration.

Important

Related concept: Removal of hardware-related macros in HAL2

Reset CRC handle state

HAL1

HAL2

#define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__)

Removed (Use HAL_CRC_DeInit() instead)


Reset CRC data register

HAL1

HAL2

#define __HAL_CRC_DR_RESET(__HANDLE__)
__STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *crcx)

Set CRC init non-default value

HAL1

HAL2

#define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__,
__INIT__)
__STATIC_INLINE void LL_CRC_SetInitialData(CRC_TypeDef *crcx,
uint32_t crc_init_value)

Store data in the independent data (ID) register

HAL1

HAL2

#define __HAL_CRC_SET_IDR(__HANDLE__,
__VALUE__)
__STATIC_INLINE void LL_CRC_WriteIDR(CRC_TypeDef *crcx,
uint32_t in_data)

Return the data stored in the independent data (ID) register

HAL1

HAL2

#define __HAL_CRC_GET_IDR(__HANDLE__)
__STATIC_INLINE uint32_t LL_CRC_ReadIDR(const CRC_TypeDef *crcx)

Set CRC output reversal

HAL1

HAL2

#define __HAL_CRC_OUTPUTREVERSAL_ENABLE(__HANDLE__)
#define __HAL_CRC_OUTPUTREVERSAL_DISABLE(__HANDLE__)
hal_status_t HAL_CRC_SetOutputReverseMode(hal_crc_handle_t *hcrc,
hal_crc_output_data_reverse_mode_t output_reverse_mode);

Set CRC non-default polynomial

HAL1

HAL2

#define __HAL_CRC_POLYNOMIAL_CONFIG(__HANDLE__,
__POLYNOMIAL__)
hal_status_t HAL_CRC_SetConfigPolynomial(hal_crc_handle_t *hcrc,
uint32_t poly_coefficient,
hal_crc_polynomial_size_t poly_size,
uint32_t crc_init_value);